package com.sample.entity;

import com.swak.App;
import com.swak.annotation.Table;
import com.swak.persistence.BaseMapper;
import com.swak.persistence.Model;

import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * 描述
 * 
 * @author Auto Generator
 * @date 2022-04-21T20:47:07.509267200
 */
@Getter
@Setter
@Accessors(chain = true)
@Table(value = "SWAK_ORDER")
public class Order extends Model<Order, Long> {

	@lombok.EqualsAndHashCode.Exclude
	@lombok.ToString.Exclude
	private static volatile transient BaseMapper<Order, Long> _mapper;

	public static final String Id = "ID";
	public static final String Name = "NAME";
	public static final String Amount = "AMOUNT";
	public static final String State = "STATE";
	public static final String CreateDate = "CREATE_DATE";
	public static final String UpdateDate = "UPDATE_DATE";
	public static final String DelFlag = "DEL_FLAG";
	public static final String DelAt = "DEL_AT";

	private String name;
	private java.math.BigDecimal amount;
	private Byte state;
	private Long goodsId;
	private String goodsName;
	private Integer goodsQuantity;
	private Long userId;
	private String userName;

	@Override
	@SuppressWarnings("unchecked")
	protected BaseMapper<Order, Long> getSqlRunner() {
		if (_mapper == null) {
			synchronized (Order.class) {
				if (_mapper == null) {
					_mapper = (BaseMapper<Order, Long>) App.getBean(getTableDefine().getMapper());
				}
			}
		}
		return _mapper;
	}

	public static Order of() {
		return new Order();
	}
}
